package com.amos.muexamclient.framework.service;

import com.amos.muexamclient.sys.service.dto.LoginUser;

import javax.servlet.http.HttpServletRequest;

/**
 * Copyright © 2018 嘉源锐信. All rights reserved.
 *
 * @Project: mu-exam
 * @ClassName: TokenService
 * @Package: com.amos.muexamclient.framework.service
 * @author: zhuqb
 * @Description:
 * @date: 2020/3/24 0024 下午 17:40
 * @Version: V1.0
 */
public interface TokenService {
    /**
     * 根据用户创建token
     *
     * @param loginUser
     * @return
     */
    String createToken(LoginUser loginUser);

    void refreshToken(LoginUser loginUser);

    /**
     * 获取用户身份信息
     *
     * @return 用户信息
     */
    LoginUser getLoginUser(HttpServletRequest request);

    /**
     * 获取请求token
     *
     * @param request
     * @return token
     */
    String getToken(HttpServletRequest request);

    void setLoginUser(LoginUser loginUser);

    void delLoginUser(String token);

    void verifyToken(LoginUser loginUser);
}
